package Memento_Pattern.RPG;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class Client {
    public static void main(String[] args) {
        MementoCaretaker mementoCaretaker=new MementoCaretaker();
        Player player=new Player(1);
        System.out.println("存档点为："+player.getNum());
        mementoCaretaker.setMemento(player.save());
        player.setNum(2);
        System.out.println("存档点为："+player.getNum());
        mementoCaretaker.setMemento(player.save());
        player.setNum(3);
        System.out.println("前往点"+player.getNum()+"死亡");
        player.restore(mementoCaretaker.getMemento());
        System.out.println("复活后点为"+player.getNum());
//        System.out.println("复活点为"+player.restore(mementoCaretaker.getMemento()));

    }
}
